package dongshi.daddy.main;

import dongshi.daddy.mymultipleexternalconfig.MyMultipleExternalConfigConsumerConfiguration;
import dongshi.daddy.mymultipleexternalconfig.MyMultipleExternalConfigConusmerService;
import dongshi.daddy.service.multipleexternalconfig.MyMultipleExternalConfigService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.IOException;

public class MyMultipleConsumerWithExternalConfigMain {
    public static void main(String[] args) throws IOException {
        AnnotationConfigApplicationContext ac
                = new AnnotationConfigApplicationContext();
        ac.register(MyMultipleExternalConfigConsumerConfiguration.class);
        ac.refresh();
        MyMultipleExternalConfigConusmerService myMultipleExternalConfigConusmerService
                = ac.getBean("myMultipleExternalConfigConusmerService", MyMultipleExternalConfigConusmerService.class);
        MyMultipleExternalConfigService myMultipleExternalConfigService = myMultipleExternalConfigConusmerService.returnClassProviderService();
        System.out.println(myMultipleExternalConfigService.sayHi("why me!!!"));
    }
}
